﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace TekaMUD.Engine.Blocks
{
	public abstract class NPC : RationalAgent
	{
		public DateTime SpawnTime { get; set; }
		public uint UpdateFrequencyTicks { get; protected set; }
		public uint UpdateTickCounter { get; set; }
		public virtual AgentAttitude Attitude { get; set;}
		
		public Mutex ControlMutex { get; set; }
		
		public abstract void PreUpdating();
		public abstract void PostUpdate();
		public abstract void Activate();

		public NPC()
		{
			ControlMutex = new Mutex();
			UpdateTickCounter = 0;
		}

	}

	public enum AgentAttitude
	{
		// Agent wants to rest.
		Rest,

		// Agent wants to move randomly
		Wander,

		// Agent wants to move to a particular room or place in the world.
		Move,

		// Agent wants to move towards a particular GameEntity
		Hunt,

		// Agent is targeting a particular Agent to initiate a combat.
		Kill,

		// Agent is hungry and is trying to find food. Eats food if possible.
		Feed,

		// Agent is feeling social.
		Social,

		// Agent is guarding a room, and will attack someone who meets some trigger.
		Guard
	}
}
